<%@ page import="utils.Book" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title>西柚书屋</title>
	<meta charset="utf-8"> 
	<script src="./bootstrap/js/jquery-3.2.1.min.js"></script> 
    <link rel="stylesheet" href="./bootstrap/css/bootstrap.min.css"> 
    <script src="./bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="css/index.css">
	<script>
		function show(id) {
		    window.location.href="/ShowInformation?bookid="+id;
        }
	</script>
</head>
<body>
	<div id="head">
		<img src="image/logo.jpg">
		<div class="input-group" id="search">
  			<input type="text" class="form-control" placeholder="输入你要查找的图书或作者" aria-describedby="basic-addon2" size="10">
  			<span class="input-group-addon" id="basic-addon2">搜索</span>
		</div>
		<% String user=(String)request.getSession().getAttribute("user");
			if (null==user)
			    user="";
		%>
		<span id="hello"><%=user%><b>您好！欢迎来到西柚书屋！</b><a href="/ExitServlet">退出</a></span>
	</div>
	<div id="content">
			<%
				ArrayList<Book> list=(ArrayList<Book>)request.getAttribute("list");
				System.out.println("list:"+list);
				if(list!=null && list.size()>0)
				{
					for(int i=0;i<list.size();i++)
					{
						request.setAttribute("id",list.get(i).getBook_id());
			%>
				<div class="book" onclick="show(<%= list.get(i).getBook_id() %>)">
					<img src="<%=list.get(i).getUrl()%>">
					<div><a href="#"><%= list.get(i).getName()%></a><br><%= list.get(i).getPublisher()%><br><span style="color: red">￥</span><%= list.get(i).getPrice()%></div>
				</div>
					<%
						}
				}
				%>
	</div>
	<footer>
		<br>关于我们 - 广告合作 - 联系我们 - 免责声明 - 网站地图 - 投诉建议 - 在线投稿<br>
              ©CopyRight 2006-2017 JB51.Net Inc All Rights Reserved. 西柚书屋
	</footer>
</body>
</html>